<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/9/22
  Time: 16:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="../css/bootstrap.min.css" />
    <link rel="stylesheet" href="../css/dashboard.css" />
    <link rel="stylesheet" href="../css/dialog.css" />
</head>
<body>
<!--上部导航栏start-->
<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">众筹管理平台</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">

            <ul class="nav navbar-nav navbar-right">
                <li><a href="../index.jsp">首页</a></li>
                <li><a href="#">欢迎, ${admin.name}</a></li>
                <li><a href="#" title="修改个人资料和密码的页面">设置</a></li>
                <li><a href="/admin/logout" title="退出登录">退出</a></li>
            </ul>
        </div>
    </div>
</nav>
<!--上部导航栏end-->
<div class="container-fluid">
    <div class="row">
        <!--左侧导航栏start-->
        <div class="col-sm-3 col-md-2 sidebar">
            <ul class="nav nav-sidebar">
                <li ><a href="../index.jsp">首页</a></li>
            </ul>
            <ul class="nav nav-sidebar">
                <li><a href="../products.jsp">所有项目*</a></li>
                <li><a href="#">项目审核</a></li>
                <li><a href="#">项目跟踪</a></li>
                <li><a href="#">项目评论</a></li>
                <li><a href="all_classity.jsp">项目分类*</a></li>
                <li><a href="#">项目推荐</a></li>
            </ul>
            <ul class="nav nav-sidebar">
                <li><a href="/user/getAllUser">注册用户</a></li>
                <li class="active"><a href="/user/getUserMoney">用户资金</a></li>
                <li><a href="userLogInfo.jsp">用户日志</a></li>
                <li><a href="/user/getAllUserAudit">实名审核</a></li>
            </ul>
            <ul class="nav nav-sidebar">
                <li><a href="">新闻管理</a></li>
                <li><a href="">问题管理</a></li>
                <li><a href="">管理用户</a></li>
                <li><a href="">管理日志</a></li>
            </ul>
        </div>
        <!--左侧导航栏end-->
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <h1 class="page-header">众筹项目分类</h1>

            <div class="panel panel-default">
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <div class="panel-title">
                      用户资金管理
                    </div>
                </div>
                <div class="panel panel-default">
                    <div class="panel-body">
                        <form class="form-inline" action="/user/getUserAndProductByName" method="post">
                            <div class="form-group">
                                <input type="text" class="form-control" id="exampleInputName2" placeholder="用户查询" name="username">
                            </div>
                            <button type="submit" class="btn btn-default btn-primary">查询</button>
                        </form>
                    </div>
                </div>

                <div class="panel-body">
                    <div class="table-responsive ">
                        <table class="table table-striped table-bordered">
                            <thead>
                            <tr>
                                <th>用户编号</th>
                                <th>用户姓名</th>
                                <th>真实姓名</th>
                                <th>项目编号</th>
                                <th>总金额</th>
                                <th>筹资金额</th>
<%--                                <th>账户余额</th>--%>
<%--                                <th>消费额</th>--%>
<%--                                <th>消费明细--%>
<%--                                <a href="#">详情</a></th>--%>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${products}" var="product">
                                <tr>
                                    <td>${product.user.id}</td>
                                    <td>${product.user.username}</td>
                                    <td>${product.user.realname}</td>
                                    <td>${product.id}</td>
                                    <td>${product.money}</td>
                                    <td>${product.getmoney}</td>
                                    <td><span class="glyphicon glyphicon-trash" id="${product.id}"></span></td>
                                </tr>
                            </c:forEach>
                            </tbody>
                        </table>
                    </div>

                    <nav aria-label="Page navigation" class="text-right">
                        <ul class="pagination">
                            <c:if test="${pageInfo.hasPreviousPage}">
                                <li class="disabled">
                                    <a href="/user/getUserMoney?pageNo=${pageInfo.pageNum-1}" aria-label="Previous">
                                        <span aria-hidden="true">&laquo;</span>
                                    </a>
                                </li>
                            </c:if>
                            <c:forEach items="${pageInfo.navigatepageNums}" var="page_Num">
                                <li
                                        <c:if test="${page_Num==pageInfo.pageNum}">
                                            class="active"
                                        </c:if>
                                >
                                    <a href="/user/getUserMoney?pageNo=${page_Num}">${page_Num}</a>
                                </li>
                            </c:forEach>
                            <c:if test="${pageInfo.hasNextPage}">
                                <li>
                                    <a href="/user/getUserMoney?pageNo=${pageInfo.pageNum+1}" aria-label="Next">
                                        <span aria-hidden="true">&raquo;</span>
                                    </a>
                                </li>
                            </c:if>
                            <li><a href="/user/getUserMoney?pageNo=${pageInfo.pages}">末页</a></li>
                        </ul>
                    </nav>

                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="../js/jquery1.12.4.min.js" ></script>
<script type="text/javascript" src="../js/bootstrap.min.js" ></script>
<script type="text/javascript" src="../js/countUp.js" ></script>
<script type="text/javascript" src="../js/dialog.js" ></script>
<script>
    $(document).ready(function () {
        $("span[class='glyphicon glyphicon-trash']").click(function () {
            alert($(this).attr('id'))
            var con=confirm("确定要删除吗?")
            if(con){
                window.location.href="/user/deleteUserAndProductById?id="+$(this).attr("id");
            }
        })
    })
</script>

</body>
</html>
